package ${package.ServiceImpl};

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biao.transaction.example.common.util.PageUtil;
import com.biao.transaction.example.dto.SearchDTO;
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

    @Autowired
    private ${table.mapperName} ${table.mapperName?uncap_first};

    @Override
    public IPage<${entity}> getPage(SearchDTO searchDTO) {
         Page<${entity}> ${entity?uncap_first}Page = new PageUtil<${entity}>().getPage(searchDTO.getCurrentPage());
         return ${table.mapperName?uncap_first}.getPage(${entity?uncap_first}Page, searchDTO);
     }

    @Override
    public boolean delete(Integer id) {
        ${entity} ${entity?uncap_first} = new ${entity}();
        ${entity?uncap_first}.setId(id);
        ${entity?uncap_first}.setIsDelete(1);
        return updateById(${entity?uncap_first});
    }

}
</#if>
